package com.lyx.rpc.protocol.response;

import com.lyx.rpc.protocol.base.RpcMessage;

/**
 * @Author by lyx
 * RPC的响应类，对应的请求id在响应头中
 */
public class RpcResponse extends RpcMessage {

    private static final long serialVersionUID = -4561937891475145803L;
    /**
     * 错误信息
     */
    private String error;
    /**
     * 返回数据
     */
    private Object result;

    public boolean isError() {
        return error != null;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
